<template>
  <div>
    <el-row class="">
      <el-col :span="22">回访记录列表</el-col>
    </el-row>
    <el-divider content-position="center"></el-divider>
    <el-row>
      <data-table
        :value="tableData"
        :total-count="totalCount"
        :table-column-attributes="tableColumnAttributes"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      >
      </data-table>
    </el-row>
  </div>
</template>

<script>
import { anewVisitList } from '@/api/after-sale/client/anewVisit'
import baseMixin from '@/mixins/base'

export default {
  components: {},
  props: {
    fromdata: Object,
  },
  mixins: [
    baseMixin({
      findData: anewVisitList,
      dataName: ['content', 'totalRecords'],
      format(res) {
        return res.map((data) => {
          return data
        })
      },
    }),
  ],
  data() {
    return {
      tableColumnAttributes: [
        { name: '工单编号', value: 'workOrderCode', type: 'text' },
        { name: '工单项目', value: 'projects', type: 'text' },
        { name: '工单金额', value: 'amount', type: 'text' },
        { name: '工单工时', value: 'sumHours', type: 'text' },
        { name: '工单完工时间', value: 'successTime', type: 'text' },
        { name: '回访状态', value: 'status', type: 'text' },
        { name: '回访人', value: 'userName', type: 'text' },
        { name: '回访时间', value: 'anewVisitTime', type: 'text' },
        { name: '回访结果', value: 'result', type: 'text' },
        { name: '回访备注', value: 'remark', type: 'text' },
      ],
      rules: [],
    }
  },
  async created() {
    this.searchOptions.clientId = this.fromdata.id
  },
  methods: {
    changeType(item) {
      this.selectedTypeText = item.label
    },
  },
  mounted() {},
}
</script>

<style lang="scss" scoped>
.el-table .delete-row {
  background: #f5f7fa;
  color: #ccc !important;
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 80px;
  height: 80px;
  display: block;
}
</style>
